package com.chen.blue.config.mybatis;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.chen.blue.interceptor.datapermission.PermissionInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created By CLT On 2023/12/5.
 */
@SuppressWarnings("all")
@Configuration
public class MybatisPlusConfig {

    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {

        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PermissionInterceptor());
        return interceptor;

    }

    @Bean
    public MetaObjectHandler metaObjectHandler() {

        return new MybatisAutoFill();

    }

}
